home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / prog / atari / c / nos042_s / mailbox.h < prev    next >
C/C++ Source or Header  |  1994-09-16  |  5KB  |  125 lines

  1. /*
  2.     -----------------------------------------------------
  3.     ATARI Version by David Nash - dnash@chaos.demon.co.uk
  4.  
  5.     add __stdargs to mbx_incom
  6.     -----------------------------------------------------
  7. */
  8.  
  9. #ifndef _MAILBOX_H
  10. #define _MAILBOX_H
  11. /* Defines for the ax.25 mailbox facility */
  12. #define NUMMBX        10        /* max number of mailbox sessions */
  13. #ifndef _TIMER_H
  14. #include "timer.h"
  15. #endif
  16.  
  17. /* a mailbox list entry */
  18. struct let {
  19.     long    start;
  20.     long    size;
  21.     int    status;
  22. };
  23.  
  24. #define MBXLINE        128        /* max length of line */
  25. struct mbx {
  26.     int state ;                /* mailbox state */
  27. #define MBX_LOGIN    0        /* trying to log in */
  28. #define MBX_CMD        1        /* in command mode */
  29. #define MBX_SUBJ    2        /* waiting for a subject line */
  30. #define MBX_DATA    3        /* collecting the message */
  31. #define MBX_REVFWD    4        /* reverse forwarding in progress */
  32. #define MBX_TRYING    5        /* pending forwarding connection */
  33. #define MBX_FORWARD    6        /* established forwarding connection */
  34.     char name[20] ;            /* Name of remote station */
  35.     char *to ;            /* To-address in form user or user@host */
  36.     char *origto ;            /* Original To-address, if rewritten */
  37.     char *tofrom ;            /* Optional <from in to-address */
  38.     char *tomsgid ;            /* Optional $msgid in to-address */
  39.     FILE *tfile ;            /* Temporary file for message, or */
  40.                     /* forwarding file. */
  41.     char line[MBXLINE+1] ;    /* Room for null at end */
  42.     int mbnum ;        /* which mailbox session is this? */
  43.     int sid ;        /* Characteristics indicated by the SID */
  44.                 /* banner of the attaching station.  If */
  45.                 /* no SID was sent, this is zero.  If an */
  46.                 /* SID of any kind was received, it is */
  47.                 /* assumed that the station supports */
  48.                 /* abbreviated mail forwarding mode. */
  49. #define    MBX_SID        0x01    /* Got any SID */
  50. #define    MBX_RLI_SID    0x02    /* This is an RLI BBS, disconnect after F> */
  51. #define MBX_HIER_SID    0x04    /* The BBS supports "hierarchical routing */
  52.                 /* designators." */
  53.                 /* Space here for others, currently not of */
  54.                 /* interest to us. */
  55.     char stype ;        /* BBS send command type (B,P,T, etc.) */
  56.     int type ;        /* Type of session when invoking "chat" */
  57.     int user;        /* User linkage area */
  58.     char escape;        /* Escape character */
  59.     int privs;        /* Privileges (taken from Ftpusers file) */
  60. #define AX25_CMD    8    /* AX.25 gateway operation allowed */
  61. #define TELNET_CMD    16    /* Telnet gateway operation allowed */
  62. #define NETROM_CMD    32    /* NET/ROM gateway operation allowed */
  63. #define SYSOP_CMD    64    /* Remote sysop access allowed */
  64. #define EXCLUDED_CMD    128    /* This user is banned from the BBS */
  65.     char *path;        /* Directory path */
  66.     char *startmsg;        /* Message to be sent at connect through any
  67.                 /* of the gateways */
  68.     int current;        /* the current message number */
  69.     int nmsgs;        /* number of messages in this mail box */
  70.     int newmsgs;        /* number of new messages in mail box */
  71.     int change;        /* mail file changed */
  72.     int anyread;        /* true if any message has been read */
  73.     FILE *mfile;        /* mail data file pointer */
  74.     char area[64];        /* name of current mail area */
  75.     long mboxsize;        /* size of mailbox when opened */
  76.     long mysize;        /* size of my private mailbox */
  77.     struct let *mbox;
  78.     char *stdinbuf;        /* the stdio buffer for the mail file */
  79.     char *stdoutbuf;    /* the stdio file io buffer for the temp file */
  80. } ;
  81. #define     NULLMBX        (struct mbx *)0
  82.  
  83. /* Structure used for automatic flushing of gateway sockets */
  84. struct gwalarm {
  85.     int s1;
  86.     int s2;
  87.     struct timer t;
  88. };
  89.  
  90. /* In mailbox.c: */
  91. extern struct mbx *Mbox[NUMMBX] ;
  92. extern char Noperm[];
  93. extern char Nosock[];
  94. extern void (*Listusers) __ARGS((int s));
  95.  
  96. int dombescape __ARGS((int argc,char *argv[],void *p));
  97. int mbxrecvline __ARGS((int s,char *buf,int len,int escape));
  98. int gw_connect __ARGS((struct mbx *m,int s,char *fsocket,int len));
  99.  
  100. #ifndef ATARI
  101. void mbx_incom __ARGS((int s,void *t,void *p));
  102. #else
  103. void __stdargs mbx_incom (int s,void *t,void *p);
  104. #endif
  105.  
  106. int domboxdisplay __ARGS((int argc,char *argv[],void *p));
  107. struct mbx *newmbx __ARGS((void));
  108. void exitbbs __ARGS((struct mbx *m));
  109. int domboxbye __ARGS((int argc,char *argv[],void *p));
  110. int mbx_parse __ARGS((struct mbx *m));
  111. void changearea __ARGS((struct mbx *m,char *area));
  112. char *rewrite_address __ARGS((char *addr));
  113. void listusers __ARGS((int s));
  114.  
  115. /* In forward.c: */
  116. int dorevfwd __ARGS((int argc,char *argv[],void *p));
  117. int dombtimer __ARGS((int argc,char *argv[],void *p));
  118. int dombkick __ARGS((int argc,char *argv[],void *p));
  119.  
  120. /* In tipmail.c */
  121. extern unsigned Tiptimeout;
  122.  
  123. #endif    /* _MAILBOX_H */
  124.  
  125.